﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="UCLHUserInfo.ascx.cs" Inherits="Web.Controls.UCLHUserInfo" %>
<%@ Register Assembly="DevExpress.Web.v15.2, Version=15.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>

    <link href="../../../../css/main.css" rel="stylesheet" />
    <link href="../../../../JS/layui/css/layui.css" rel="stylesheet" />
    <script src="../../../../JS/layui/layui.js"></script>
    <script defer src="../../../../PageJS/common.js"></script>
    <script src="../../../../PageJS/common.verify.js"></script>

<script language="javascript" type="text/javascript">
    
</script>
<script type="text/javascript">
    //$(function () {

    //});

    function OpenDingE() {
        /*
        myWindow = window.open("../18.weihu/jh_dingejs_school.aspx?yonghuh=" + txtConYongHuH.GetText() + "&ssdx=" + cmbSheShuiDXDM.GetValue(),
            "_blank", "width=1000,height=800,resizable=yes,toolbar=no,menubar=no,scrollbars=yes,status=no,location=no");
        myWindow.focus();
        */
        layer.open({
            type: 2,
            title: "定额计算",
            shadeClose: true,
            shade: 0.8,
            area: ['1000px', '600px'],
            content: "../../YongShui/18.weihu/jh_dingejs_school.aspx?yonghuh=" + UCLHUserInfo_txtYongHuH.GetText(),
            end: function () {
                load();
            }
        });
    }

    function load() {
    }

    function GetValue(type) {
        if (type == 'yonghuh') {
            return UCLHUserInfo_hdCollection.Get("yonghuh");
        }
        else if (type == 'y') {
            return UCLHUserInfo_txtY.GetText();
        }
        else if (type == 'm') {
            return UCLHUserInfo_txtM.GetText();
        }
        else if (type == 'zhandian') {
            return UCLHUserInfo_hdCollection.Get("ZHANDIANBH");
        }
        else if (type == 'guanlik') {
            return UCLHUserInfo_hdCollection.Get("GUANLIKBH");
        }
        else {
            return "";
        }
    }
    function UCLHUserInfo_txtYongHuHKeyPress() {
        if (event.keyCode == 13) {
            setTimeout(function () {

            }, 0);
            event.preventDefault ? event.preventDefault() : (event.returnValue = false);
            if (UCLHUserInfo_txtYongHuH.GetText() == '') {
                alert('请输入用户号。');
                UCLHUserInfo_txtYongHuM.SetText("");
                UCLHUserInfo_txtYongHuH.Focus();
                return;
            }
            UCLHUserInfo_ASPxCallback1.PerformCallback("yonghuh");
        }
    }
   

    function UCLHUserInfo_txtYMKeyPress(s) {
        //debugger;
        inputNum(s);
        if (event.keyCode == 13) {
            setTimeout(function () {

            }, 0);
            event.preventDefault ? event.preventDefault() : (event.returnValue = false);
            if (UCLHUserInfo_txtYongHuH.GetText() == '') {
                alert('请输入用户号。');
                UCLHUserInfo_txtYongHuH.Focus();
                return;
            }
            //if (UCLHUserInfo_txtYongHuM.GetText() == '') {
            //    alert('请查询出用户信息。');
            //    UCLHUserInfo_txtYongHuH.Focus();
            //    return;
            //}
            //debugger;
            if (typeof (UCLHUserInfo_txtY) != undefined) {
                if (UCLHUserInfo_txtY.GetText() == '') {
                    alert('请输入水量年。');
                    UCLHUserInfo_txtY.Focus();
                    return;
                }
                if (typeof (UCLHUserInfo_txtM) != 'undefined' && s.name == 'UCLHUserInfo_txtY') {
                    if (UCLHUserInfo_txtM.GetText() == '') {
                        UCLHUserInfo_txtM.Focus();
                        return;
                    }
                }
                //debugger;
                if (typeof (UCLHUserInfo_txtM) != 'undefined' && s.name == 'UCLHUserInfo_txtM') {
                    if (UCLHUserInfo_txtM.GetText() == '') {
                        alert('请输入水量月。');
                        UCLHUserInfo_txtM.Focus();
                        return;
                    }
                }
            }

            UCLHUserInfo_ASPxCallback1.PerformCallback("ym");
        }
    }


    //异步回调接收事件   
    function UCLHUserInfo_ASPxCallbackCommonComplete(rs) {
        var arr = rs.split('|');
        var type = arr[0];
        var state = arr[1];
        var specialIdentity = arr[2];
        var msg = arr[3].split('-');
        if (msg[0] == 'True') {
            alert(msg[1]);
        }
        UCLHUserInfo_hdCollection.Set("type", type);
        if (state == 'True') {
            UCLHUserInfo_hdCollection.Set("yonghuh", UCLHUserInfo_txtYongHuH.GetText());
            if (type == "yonghuh") {
                UCLHUserInfo_txtYongHuM.SetText(arr[4]);
                UCLHUserInfo_txtDiZhi.SetText(arr[5]);
                UCLHUserInfo_txtYouBian.SetText(arr[6]);
                UCLHUserInfo_txtLianXiBM.SetText(arr[7]);
                UCLHUserInfo_txtLianXiR.SetText(arr[8]);
                UCLHUserInfo_txtLianXiDH.SetText(arr[9]);
                //UCLHUserInfo_hdCollection.Set("ZHANDIANBH", arr[10]);
                //UCLHUserInfo_hdCollection.Set("GUANLIKBH", arr[11]);
                //加载已上传的材料
                //alert(arr[10] + "-" + arr[11] + "-" + arr[12]);
                if (arr.length >= 11) {
                    if (typeof (cblCAILIAO) != 'undefined') {
                        //清除所有
                        cblCAILIAO.UnselectAll();
                        //重新选中
                        if (arr[10] != "" && arr[10] != "-1") {
                            cblCAILIAO.SelectIndices(arr[10]);
                        }
                    }
                    /*
                    var clIndexs;
                    for (var i = 10; i < arr.length; i++) {
                        clIndexs = arr[i];
                        if (typeof (SetSelectValue) != 'undefined') {
                            SetSelectValue(clIndexs);
                        }
                    }  
                    */
                }
                if (typeof (UCLHUserInfo_txtY) != 'undefined') {
                    if (UCLHUserInfo_txtY.GetText() == "") {
                        UCLHUserInfo_txtY.Focus();
                        return;
                    }
                }
                if (typeof (UCLHUserInfo_txtM) != 'undefined') {
                    if (UCLHUserInfo_txtM.GetText() == '') {
                        UCLHUserInfo_txtM.Focus();
                        return;
                    }
                }
                UCLHUserInfo_ASPxCallback1.PerformCallback("ym");
            }
            else if (type == "ym") {
                
                if (specialIdentity != '0' && specialIdentity != "") {
                    UCLHUserInfo_txtYongHuM.SetText(specialIdentity);
                }
                if (typeof (UCLHUserInfo_txtY) != 'undefined') {
                    UCLHUserInfo_hdCollection.Set("Y", UCLHUserInfo_txtY.GetText());
                }

                if (typeof (YM) == 'function') {
                    YM();
                }
                else {
                    UCLHUserInfo_btnActPerform.onClick();
                }
            }
        }
        else {
            if (type == "yonghuh") {
                UCLHUserInfo_hdCollection.Set("yonghuh", "");
                UCLHUserInfo_txtYongHuM.SetText("");
                UCLHUserInfo_txtDiZhi.SetText("");
                UCLHUserInfo_txtYouBian.SetText("");
                UCLHUserInfo_txtLianXiBM.SetText("");
                UCLHUserInfo_txtLianXiR.SetText("");
                UCLHUserInfo_txtLianXiDH.SetText("");
            }
            else if (type == "ym") {
                UCLHUserInfo_hdCollection.Set("Y", "");
            }
        }
    }
</script>
<div style="display: none;">
    <dx:ASPxButton ID="btnActPerform" ClientInstanceName="UCLHUserInfo_btnActPerform" runat="server" Text="ASPxButton" UseSubmitBehavior="false" OnClick="btnActPerform_Click"></dx:ASPxButton>
</div>
<dx:ASPxHiddenField ID="hdCollection" ClientInstanceName="UCLHUserInfo_hdCollection" runat="server"></dx:ASPxHiddenField>
<dx:ASPxCallback ID="ASPxCallback1" ClientInstanceName="UCLHUserInfo_ASPxCallback1" runat="server" OnCallback="ASPxCallback1_Callback" ClientSideEvents-CallbackComplete="function(s,e){UCLHUserInfo_ASPxCallbackCommonComplete(e.result);}"></dx:ASPxCallback>
<fieldset style="border: 1px solid  cornflowerblue; width: 97%; margin: auto;">
    <legend><b>用户基本信息</b></legend>
    <table width="100%">
        <tr>
            <td align="right" style="width: 12%">登记文号：
            </td>
            <td style="width: 17%">
                <dx:ASPxTextBox ID="txtLaiHanBH" ClientInstanceName = "txtLaiHanBH" ReadOnly="true" runat="server" Width="100%" Text=""></dx:ASPxTextBox>
            </td>
            <td align="right" style="width: 16%">
                <dx:ASPxLabel ID="lblXuKeSLH" runat="server" Text="许可受理号："></dx:ASPxLabel>
            </td>
            <td style="width: 17%">
                <dx:ASPxTextBox ID="txtXuKeSLH" ReadOnly="true" runat="server" Text="" Width="100%"></dx:ASPxTextBox>
            </td>
            <td align="right" style="width: 16%">
                <dx:ASPxLabel ID="lblTongYiSPBH" runat="server" Text="统一审批编码："></dx:ASPxLabel>
            </td>
            <td style="width: 17%">
                <dx:ASPxTextBox ID="txtTongYiSPBH" ReadOnly="true" runat="server" Text="" Width="99%"></dx:ASPxTextBox>
            </td>
            <td rowspan="4"></td>
        </tr>
        <tr>
            <td align="right">用户号：
            </td>
            <td>
                <dx:ASPxTextBox ID="txtYongHuH" ClientInstanceName="UCLHUserInfo_txtYongHuH" runat="server" Text="" Width="100%" ClientSideEvents-KeyPress="function(s,e){UCLHUserInfo_txtYongHuHKeyPress();}"></dx:ASPxTextBox>
                <%--<table style="width: 100%">
                    <tr>
                        <td style="width: 60%">
                            <dx:ASPxTextBox ID="txtYongHuH" ClientInstanceName="UCLHUserInfo_txtYongHuH" runat="server" Text="" Width="100%" ClientSideEvents-KeyPress="function(s,e){UCLHUserInfo_txtYongHuHKeyPress();}"></dx:ASPxTextBox>
                        </td>
                        <td>
                            <dx:ASPxButton runat="server" ID="btnChaXun" UseSubmitBehavior="false" Text="查询" AutoPostBack="false" ClientSideEvents-Click="function(s,e){UCLHUserInfo_CX();}">
                            </dx:ASPxButton>
                        </td>
                    </tr>
                </table>--%>

            </td>
            <td align="right">用户名：
            </td>
            <td colspan="3">
                <dx:ASPxTextBox ID="txtYongHuM" ClientInstanceName="UCLHUserInfo_txtYongHuM" runat="server" Text="" Width="99.5%"></dx:ASPxTextBox>
            </td>
        </tr>
        <tr>
            <td align="right">地址：
            </td>
            <td colspan="3">
                <dx:ASPxTextBox ID="txtDiZhi" ClientInstanceName="UCLHUserInfo_txtDiZhi" runat="server" Text="" Width="100%"></dx:ASPxTextBox>
            </td>
            <td align="right">邮编：
            </td>
            <td>
                <dx:ASPxTextBox ID="txtYouBian" ClientInstanceName="UCLHUserInfo_txtYouBian" runat="server" Text="" Width="99%"></dx:ASPxTextBox>
            </td>
        </tr>
        <tr>
            <td align="right">联系部门：
            </td>
            <td>
                <dx:ASPxTextBox ID="txtLianXiBM" ClientInstanceName="UCLHUserInfo_txtLianXiBM" runat="server" Text="" Width="100%"></dx:ASPxTextBox>
            </td>
            <td align="right">联系人：
            </td>
            <td>
                <dx:ASPxTextBox ID="txtLianXiR" ClientInstanceName="UCLHUserInfo_txtLianXiR" runat="server" Text="" Width="100%"></dx:ASPxTextBox>
            </td>
            <td align="right">联系电话：
            </td>
            <td>
                <dx:ASPxTextBox ID="txtLianXiDH" ClientInstanceName="UCLHUserInfo_txtLianXiDH" runat="server" Text="" Width="99%"></dx:ASPxTextBox>
            </td>
        </tr>
        <tr>
            <td align="right">联系手机：
            </td>
            <td>
                <dx:ASPxTextBox ID="txtLianXiSJ" ClientInstanceName="UCLHUserInfo_txtLianXiSJ" runat="server" Text="" Width="100%"></dx:ASPxTextBox>
            </td>
            <td align="right">
                <dx:ASPxLabel ID="lblY" runat="server" Text="水量年："></dx:ASPxLabel>
            </td>
            <td>
                <dx:ASPxTextBox ID="txtY" ClientInstanceName="UCLHUserInfo_txtY" runat="server" Text="" Width="100%" ClientSideEvents-KeyUp="function(s,e){UCLHUserInfo_txtYMKeyPress(s);}"></dx:ASPxTextBox>
            </td>
            <td align="right">
                <dx:ASPxLabel ID="lblM" runat="server" Text="水量月："></dx:ASPxLabel>
            </td>
            <td>
                <dx:ASPxTextBox ID="txtM" ClientInstanceName="UCLHUserInfo_txtM" runat="server" Width="99%" ClientSideEvents-KeyUp="function(s,e){UCLHUserInfo_txtYMKeyPress(s);}"></dx:ASPxTextBox>
                <dx:ASPxHyperLink ID="btnDinge" runat="server" ClientInstanceName="UCLHUserInfo_btnDinge" Visible="False" Cursor="pointer">
                    <ClientSideEvents Click="OpenDingE" />
                </dx:ASPxHyperLink>
            </td>
        </tr>
    </table>
</fieldset>
